﻿Imports Alquilaqi
Public Class CentroEstudioEliminar
    Public centroestudioAgregarForm As CentroEstudioMain
    Private Sub Buscarbt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buscarbt.Click
        Dim criterio As String = Me.buscarT.Text
        'MsgBox(criterio)

        Dim negocio As New CentroEstudioNegocio
        Dim centroestudio As Collection = negocio.buscarPorNombre(criterio)
        Me.dgcentroestudio.DataSource = centroestudio
        Me.dgcentroestudio.EditMode = False

        If centroestudio.Count > 0 Then
            Me.dgcentroestudio.Columns(0).Visible = False 'id centro estudio
            'Me.dgcentroestudio.Columns(1).HeaderText = "id centro estudio"
            Me.dgcentroestudio.Columns(1).HeaderText = "Distriro"
            Me.dgcentroestudio.Columns(2).HeaderText = "Centro de estudio"
            Me.dgcentroestudio.Columns(3).HeaderText = "Dirección"
        End If

        With Me.dgcentroestudio.ColumnHeadersDefaultCellStyle
            .BackColor = Color.Red
            .ForeColor = Color.White
        End With


    End Sub

    Private Sub CEEliminarbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CEEliminarbtn.Click
        Dim seleccionado1 = Me.dgcentroestudio.CurrentRow.Cells(0).Value.ToString
        Dim negocio As New CentroEstudioNegocio
        negocio.eliminar(seleccionado1)
        dgcentroestudio.DataSource = ""
    End Sub
End Class